\(\int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx\) [20]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 98 \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}+\frac {b \text {arctanh}(\sin (c+d x))}{d}-\frac {b \csc (c+d x)}{d}-\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \csc ^3(c+d x)}{3 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d} \]

[Out]

-3/8*a*arctanh(cos(d*x+c))/d+b*arctanh(sin(d*x+c))/d-b*csc(d*x+c)/d-3/8*a*cot(d*x+c)*csc(d*x+c)/d-1/3*b*csc(d*
x+c)^3/d-1/4*a*cot(d*x+c)*csc(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3598, 3853, 3855, 2701, 308, 213} \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}+\frac {b \text {arctanh}(\sin (c+d x))}{d}-\frac {b \csc ^3(c+d x)}{3 d}-\frac {b \csc (c+d x)}{d} \]

[In]

Int[Csc[c + d*x]^5*(a + b*Tan[c + d*x]),x]

[Out]

(-3*a*ArcTanh[Cos[c + d*x]])/(8*d) + (b*ArcTanh[Sin[c + d*x]])/d - (b*Csc[c + d*x])/d - (3*a*Cot[c + d*x]*Csc[
c + d*x])/(8*d) - (b*Csc[c + d*x]^3)/(3*d) - (a*Cot[c + d*x]*Csc[c + d*x]^3)/(4*d)

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 2701

Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(f*a^n)^(-1), Subst
[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && Integer
Q[(n + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 3598

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Expand[Sin[e
+ f*x]^m*(a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (a \csc ^5(c+d x)+b \csc ^4(c+d x) \sec (c+d x)\right ) \, dx \\ & = a \int \csc ^5(c+d x) \, dx+b \int \csc ^4(c+d x) \sec (c+d x) \, dx \\ & = -\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {1}{4} (3 a) \int \csc ^3(c+d x) \, dx-\frac {b \text {Subst}\left (\int \frac {x^4}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d} \\ & = -\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {1}{8} (3 a) \int \csc (c+d x) \, dx-\frac {b \text {Subst}\left (\int \left (1+x^2+\frac {1}{-1+x^2}\right ) \, dx,x,\csc (c+d x)\right )}{d} \\ & = -\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {b \csc (c+d x)}{d}-\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \csc ^3(c+d x)}{3 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {b \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d} \\ & = -\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}+\frac {b \text {arctanh}(\sin (c+d x))}{d}-\frac {b \csc (c+d x)}{d}-\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \csc ^3(c+d x)}{3 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.10 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.54 \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {3 a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {b \csc ^3(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},\sin ^2(c+d x)\right )}{3 d}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \]

[In]

Integrate[Csc[c + d*x]^5*(a + b*Tan[c + d*x]),x]

[Out]

(-3*a*Csc[(c + d*x)/2]^2)/(32*d) - (a*Csc[(c + d*x)/2]^4)/(64*d) - (b*Csc[c + d*x]^3*Hypergeometric2F1[-3/2, 1
, -1/2, Sin[c + d*x]^2])/(3*d) - (3*a*Log[Cos[(c + d*x)/2]])/(8*d) + (3*a*Log[Sin[(c + d*x)/2]])/(8*d) + (3*a*
Sec[(c + d*x)/2]^2)/(32*d) + (a*Sec[(c + d*x)/2]^4)/(64*d)

Maple [A] (verified)

Time = 3.68 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.92

method result size
derivativedivides \(\frac {b \left (-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a \left (\left (-\frac {\left (\csc ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \csc \left (d x +c \right )}{8}\right ) \cot \left (d x +c \right )+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) \(90\)
default \(\frac {b \left (-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a \left (\left (-\frac {\left (\csc ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \csc \left (d x +c \right )}{8}\right ) \cot \left (d x +c \right )+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) \(90\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (9 i a \,{\mathrm e}^{6 i \left (d x +c \right )}+24 b \,{\mathrm e}^{6 i \left (d x +c \right )}-33 i a \,{\mathrm e}^{4 i \left (d x +c \right )}-104 b \,{\mathrm e}^{4 i \left (d x +c \right )}-33 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+104 b \,{\mathrm e}^{2 i \left (d x +c \right )}+9 i a -24 b \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(200\)

[In]

int(csc(d*x+c)^5*(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(b*(-1/3/sin(d*x+c)^3-1/sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))+a*((-1/4*csc(d*x+c)^3-3/8*csc(d*x+c))*cot(d*
x+c)+3/8*ln(csc(d*x+c)-cot(d*x+c))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 213 vs. \(2 (90) = 180\).

Time = 0.28 (sec) , antiderivative size = 213, normalized size of antiderivative = 2.17 \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=\frac {18 \, a \cos \left (d x + c\right )^{3} - 30 \, a \cos \left (d x + c\right ) - 9 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 9 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 24 \, {\left (b \cos \left (d x + c\right )^{4} - 2 \, b \cos \left (d x + c\right )^{2} + b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 24 \, {\left (b \cos \left (d x + c\right )^{4} - 2 \, b \cos \left (d x + c\right )^{2} + b\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 16 \, {\left (3 \, b \cos \left (d x + c\right )^{2} - 4 \, b\right )} \sin \left (d x + c\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]

[In]

integrate(csc(d*x+c)^5*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/48*(18*a*cos(d*x + c)^3 - 30*a*cos(d*x + c) - 9*(a*cos(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(1/2*cos(d*x
+ c) + 1/2) + 9*(a*cos(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(-1/2*cos(d*x + c) + 1/2) + 24*(b*cos(d*x + c)^
4 - 2*b*cos(d*x + c)^2 + b)*log(sin(d*x + c) + 1) - 24*(b*cos(d*x + c)^4 - 2*b*cos(d*x + c)^2 + b)*log(-sin(d*
x + c) + 1) + 16*(3*b*cos(d*x + c)^2 - 4*b)*sin(d*x + c))/(d*cos(d*x + c)^4 - 2*d*cos(d*x + c)^2 + d)

Sympy [F]

\[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right ) \csc ^{5}{\left (c + d x \right )}\, dx \]

[In]

integrate(csc(d*x+c)**5*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*csc(c + d*x)**5, x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.26 \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=\frac {3 \, a {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{3} - 5 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 8 \, b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} + 1\right )}}{\sin \left (d x + c\right )^{3}} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]

[In]

integrate(csc(d*x+c)^5*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/48*(3*a*(2*(3*cos(d*x + c)^3 - 5*cos(d*x + c))/(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1) - 3*log(cos(d*x + c)
+ 1) + 3*log(cos(d*x + c) - 1)) - 8*b*(2*(3*sin(d*x + c)^2 + 1)/sin(d*x + c)^3 - 3*log(sin(d*x + c) + 1) + 3*l
og(sin(d*x + c) - 1)))/d

Giac [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.81 \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=\frac {3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 8 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 192 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 192 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 72 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 120 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {150 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 120 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]

[In]

integrate(csc(d*x+c)^5*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/192*(3*a*tan(1/2*d*x + 1/2*c)^4 - 8*b*tan(1/2*d*x + 1/2*c)^3 + 24*a*tan(1/2*d*x + 1/2*c)^2 + 192*b*log(abs(t
an(1/2*d*x + 1/2*c) + 1)) - 192*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 72*a*log(abs(tan(1/2*d*x + 1/2*c))) - 1
20*b*tan(1/2*d*x + 1/2*c) - (150*a*tan(1/2*d*x + 1/2*c)^4 + 120*b*tan(1/2*d*x + 1/2*c)^3 + 24*a*tan(1/2*d*x +
1/2*c)^2 + 8*b*tan(1/2*d*x + 1/2*c) + 3*a)/tan(1/2*d*x + 1/2*c)^4)/d

Mupad [B] (verification not implemented)

Time = 4.63 (sec) , antiderivative size = 211, normalized size of antiderivative = 2.15 \[ \int \csc ^5(c+d x) (a+b \tan (c+d x)) \, dx=\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {5\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {2\,b\,\mathrm {atanh}\left (\frac {4\,b^2}{\frac {3\,a\,b}{2}-4\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {3\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,\left (\frac {3\,a\,b}{2}-4\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}\right )}{d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}+\frac {3\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {10\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+\frac {a}{4}}{16\,d\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4} \]

[In]

int((a + b*tan(c + d*x))/sin(c + d*x)^5,x)

[Out]

(a*tan(c/2 + (d*x)/2)^2)/(8*d) - (5*b*tan(c/2 + (d*x)/2))/(8*d) - (2*b*atanh((4*b^2)/((3*a*b)/2 - 4*b^2*tan(c/
2 + (d*x)/2)) - (3*a*b*tan(c/2 + (d*x)/2))/(2*((3*a*b)/2 - 4*b^2*tan(c/2 + (d*x)/2)))))/d + (a*tan(c/2 + (d*x)
/2)^4)/(64*d) - (b*tan(c/2 + (d*x)/2)^3)/(24*d) + (3*a*log(tan(c/2 + (d*x)/2)))/(8*d) - (a/4 + (2*b*tan(c/2 +
(d*x)/2))/3 + 2*a*tan(c/2 + (d*x)/2)^2 + 10*b*tan(c/2 + (d*x)/2)^3)/(16*d*tan(c/2 + (d*x)/2)^4)